// 统一处理所有的请求

import axios from './index'



// 管理员登录请求
export const Login = data => axios({
  method: 'POST',
  url: '/admin/login',
  data
})

// 员工登录请求
export const loginPost = data => axios({
  method: 'POST',
  url: '/user/login',
  data
})

//获取入库信息
export const getKuList = () => axios({
  method: 'GET',
  url: '/putStorage/selectAllPutStorage',
})

//------下面是段宏博的接口部分-----
//---客户主页的接口
//客户信息列表获取
export const getclientList = data => axios({
  method: 'post',
  url: '/vip/selectAll',
  data

})
//客户信息的模糊查询
export const searchclient = data => axios({
  method: 'post',
  url: '/vip/selectByLike',
  data
})
//客户删除接口
export const deleteclient = (id) => axios({
  method: 'post',
  url: '/vip/delete?id=' + id,

})
//新增客户信息的接口
export const addclientlist = data => axios({
  method: 'post',
  url: '/vip/add',
  data
})
//修改用户信息
export const updateclient = data => axios({
  method: 'post',
  url: '/vip/update',
  data
})
//使用id查询单条数据
export const idsearch = (id) => axios({
  method: 'post',
  url: '/vip/selectById?id=' + id,
})
//获取会员卡类别信息渲染下拉框
export const viplist = () => axios({
  method: 'post',
  url: '/vip/toCardType',
})
// //---会员卡管理的接口
//获取列表
export const getcardList = data => axios({
  method: 'post',
  url: '/card/selectAll',
  data
})
//删除对应行
export const deleteCard = (id) => axios({
  method: 'post',
  url: '/card/delete?id=' + id,
})
//使用id查询单条数据
export const cardidsearch = (id) => axios({
  method: 'post',
  url: '/card/selectById?id=' + id,
})
//提交修改信息接口
export const updatecard = data => axios({
  method: 'post',
  url: '/card/update',
  data
})
//提交新增信息接口
export const addcardlist = data => axios({
  method: 'post',
  url: '/card/add',
  data
})
//---积分管理的接口
//获取列表
export const getcreditsList = data => axios({
  method: 'post',
  url: '/sRule/selectAll',
  data
})
//删除对应行
export const deletecredits = (id) => axios({
  method: 'post',
  url: '/sRule/delete?id=' + id,
})
//使用id查询单条数据
export const creditsidsearch= (id) => axios({
  method: 'post',
  url: '/sRule/selectById?id=' + id,
})
//提交修改信息接口
export const updatecredits = data => axios({
  method: 'post',
  url: '/sRule/update',
  data
})
//提交新增信息接口
export const addcreditslist = data => axios({
  method: 'post',
  url: '/sRule/add',
  data
})
//积分信息的模糊查询
export const searchcredits = data => axios({
  method: 'post',
  url: '/sRule/selectByLike',
  data
})



//------上面是段宏博的接口部分-----
//商品添加
export const addGoods = data => axios({
  method: 'POST',
  url: '/putStorage/insertCommodity', //添加
  data

})
export const wllquanxian = data => axios({
  method: 'POST',
  url: '/role/addRole',
  // headers: {'Accept':'*/*','Content-Type': 'application/x-www-form-urlencoded'},
  data
})
//编辑角色
export const wllquanxianBianji = data => axios({
  method: 'POST',
  url: '/role/edit',
  // headers: {'Accept':'*/*','Content-Type': 'application/x-www-form-urlencoded'},
  data
})
//删除角色
export const wllquanxiandel = data => axios({
  method: 'POST',
  url: '/role/delete',
  // headers: {'Accept':'*/*','Content-Type': 'application/x-www-form-urlencoded'},
  data
})
//保存
export const save = () => axios({
  method: 'GET',
  url: '/purview/selectAllPurviewByRoleId',
  // headers: {'Accept':'*/*','Content-Type': 'application/x-www-form-urlencoded'},

})
//添加弹框便利按钮
export const wllbianli =()=> axios({
  method: 'GET',
  url: '/role/selectAll',
  // headers: {'Accept':'*/*','Content-Type': 'application/x-www-form-urlencoded'},
  
})

//保存
export const pagesave =data=> axios({
  method: 'POST',
  url: '/purview/addPurview',
  // headers: {'Accept':'*/*','Content-Type': 'application/x-www-form-urlencoded'},
  data
})


//商品测试接口
export const testPost = data => axios({
  method: 'POST',
  // url: '/putStorage/selectByLike',//多条件查询
  url: '/putStorage/deleteById', //依据传回的id数组， 实现单 / 多删除

  // url: '/putStorage/updateCommodity', //编辑商品信息操作
  // url: '/putStorage/selectByLike', //多条件查询
  // url: '/putStorage/insertCommodity', //添加
  data

})
// export const testGet = () => axios({
//     method: 'GET',
//     url: '/putStorage/selectAllPutStorage',
// })

//获取供应商信息
export const lszgon = data => axios({
  method: 'POST',
  url: '/supply/selectAllSupply',
  headers:{
    'content-type': 'application/json;charset=UTF-8'
  },
  data
 
})
export const lszsearch = data => axios({
  method: 'POST',
  url: '/supply/selectLikeName',
  headers:{
    'content-type': 'application/json;charset=UTF-8'
  },
  data
})
// export const lszsearch =data=> axios({
//   method: 'POST',
//   url: '/supply/inSupply',
//   headers:{
//     'content-type': 'application/x-www-form-urlencoded'
//   },
//   data
// })
//获取员工信息
export const staffgetPost = (page, size) => axios({
  method: 'GET',
  url: '/user/selectAllByPage?page=' + page + '&size=' + size
})
//员工删除//批量删除
export const delPost = (id) => axios({
  method: 'POST',
  url: '/user/deleteUserById?id=' + id
})
//员工注册
export const addPost = (data) => axios({
  method: 'POST',
  url: '/user/register',
  data
})
//获取门店树状结构信息
export const getlist =()=> axios({
  method: 'POST',
  url: 'sunnshop/link'
})
export const getSumShop =()=> axios({
  method: 'POST',
  url: 'sunnshop/link'
})
//获取总店信息
// export const getSumShop =()=> axios({
//   method: 'POST',
//   url: '/sunnshop/link'
// })
//添加总店
// export const addSumShop =()=> axios({
//   method: 'POST',
//   url: 'application/json',
//   data
// })
//员工电话查询接口
export const stafffindPost = (data) => axios({
  method: 'POST',
  url: '/user/selectByLike',
  data
 
})
// 员工编辑请求
export const staffeditorPost = (data) => axios({
  method: 'POST',
  url: '/user/editUser',
  data
})
//添加分组
export const addclassPost = (data) => axios({
  method: 'POST',
  url: '/user/insertGroup',
  data
})
//获取分组
export const getclassPost = () => axios({
  method: 'GET',
  url: '/user/selectGroup'
})
//删除分组
export const delclassPost = (data) => axios({
  method: 'POST',
  url: '/user/deleteGroupById',
  data
})
//分组编辑业务
export const editorclassPost = (data) => axios({
  method: 'POST',
  url: '/user/editGroup',
  data
})





//编辑商品编码
export const editgoodsCode = (data) => axios({
  method: 'POST',
  url: '/product/update',
  data
})
//新增商品编码
export const addgoodsCode = (data) => axios({
  method: 'POST',
  url: '/product/add',
  data
})

//分页获取产品表信息
export const getPageList = (data) => axios({
  method: 'POST',
  url: '/product/selectAllByPage',
 data
})

//打开页面显示当前产品编码列表信息
export const getCodeList = () => axios({
  method: 'POST',
  url: '/product/selectAll',
})

//点击删除按钮，删除当前行产品编码信息
export const deleteCode = (data) => axios({
  method: 'POST',
  url: '/product/deletes',
  data
})


//点击搜索，显示符合条件的产品编码信息
export const selectLikeCoding = (data) => axios({
  method: 'POST',
  url: '/product/selectLikeCoding',
  // contentType : "application/json" ,
  data
})


//工费管理
//打开页面显示当前工费列表信息
export const getCostList = () => axios({
  method: 'POST',
  url: '/pdcost/selectAll',
})

//---新增工费接口---
export const addCost = (data) => axios({
  method: 'POST',
  url: '/pdcost/add',
  data
})

//点击删除按钮，删除当前工费信息
export const deleteCost = (data) => axios({
  method: 'POST',
  url: '/pdcost/deletePdcost',
  data
})

//编辑工费信息
export const editCost = (data) => axios({
  method: 'POST',
  url: '/pdcost/updatePdcost',
  data
})